package com.wilmer.bankarea.controller;

import java.util.List;

import com.wilmer.common.annotation.Anonymous;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.wilmer.common.core.controller.BaseController;
import com.wilmer.common.core.domain.AjaxResult;
import com.wilmer.bankarea.domain.BankArea;
import com.wilmer.bankarea.service.IBankAreaService;

/**
 * 地区Controller
 * 
 * @author hans
 * @date 2024-03-31
 */
@Api(tags = "全国各地市接口")
@RestController
@RequestMapping("/areas")
public class BankAreaController extends BaseController
{
    @Autowired
    private IBankAreaService bankAreaService;

    /**
     * 查询地区列表
     */
    @ApiOperation("获取全国各地市，无需携带参数，可以匿名访问")
    @Anonymous
    @GetMapping("/getList")
    public AjaxResult list()
    {
        List<BankArea> list = bankAreaService.selectBankAreaList();
        return AjaxResult.success(list);
    }

    /**
     * 查询地区列表
     */
    @ApiOperation("获取各地市，无需携带参数，可以匿名访问")
    @Anonymous
    @GetMapping("/getArea")
    public AjaxResult getArea()
    {
        return AjaxResult.success(bankAreaService.getArea());
    }

}
